package com.bango.android;

import org.json.JSONObject;

public class BangoProfile
{
	private int _profileId;

	private int _sdkType;
	private String _sdkVersion;
	private String _applicationId;
	private String _applicationType;
	private String _applicationChannel;
	private String _applicationVersion;
	private String _userId;
	private int _connectionType;
	private boolean _isRoaming;
	private String _locationSource;
	private double _locationAltitude;
	private double _locationLatitude;
	private double _locationLongitude;
	private float _locationAccuracy;
	private int _sessionRestartTime;
	private String _operator;
	private String _operatorName;
	private String _operatorCountryIso;
	private String _brand;
	private String _device;
	private String _model;
	private String _product;
	private String _version;
	private String _buildId;
	private int _operatorConnectionType;
	private String _simOperator;
	private String _bangoUserId;

	public void ProfileId(int profileId)
	{
		_profileId = profileId;
	}

	public void SdkType(int sdkType)
	{
		_sdkType = sdkType;
	}

	public void SdkVersion(String sdkVersion)
	{
		_sdkVersion = sdkVersion;
	}

	public void ApplicationId(String applicationId)
	{
		_applicationId = applicationId;
	}

	public void ApplicationType(String applicationType)
	{
		_applicationType = applicationType;
	}

	public void ApplicationChannel(String applicationChannel)
	{
		_applicationChannel = applicationChannel;
	}

	public void ApplicationVersion(String applicationVersion)
	{
		_applicationVersion = applicationVersion;
	}

	public void UserId(String userId)
	{
		_userId = userId;
	}

	public void SessionRestartTime(int sessionRestartTime)
	{
		_sessionRestartTime = sessionRestartTime;
	}

	public void ConnectionType(int connectionType)
	{
		_connectionType = connectionType;
	}

	public void IsRoaming(boolean isRoaming)
	{
		_isRoaming = isRoaming;
	}

	public void LocationSource(String locationSource)
	{
		_locationSource = locationSource;
	}

	public void LocationAltitude(double locationAltitude)
	{
		_locationAltitude = locationAltitude;
	}

	public void LocationLatitude(double locationLatitude)
	{
		_locationLatitude = locationLatitude;
	}

	public void LocationLongitude(double locationLongitude)
	{
		_locationLongitude = locationLongitude;
	}

	public void LocationAccuracy(float locationAccuracy)
	{
		_locationAccuracy = locationAccuracy;
	}

	public void Operator(String operator)
	{
		_operator = operator;
	}

	public void OperatorName(String operatorName)
	{
		_operatorName = operatorName;
	}

	public void OperatorCountryIso(String operatorCountryIso)
	{
		_operatorCountryIso = operatorCountryIso;
	}

	public void SimOperator(String simOperator)
	{
		_simOperator = simOperator;
	}

	public void Brand(String brand)
	{
		_brand = brand;
	}

	public void Device(String device)
	{
		_device = device;
	}

	public void Model(String model)
	{
		_model = model;
	}

	public void Product(String product)
	{
		_product = product;
	}

	public void Version(String version)
	{
		_version = version;
	}

	public void BuildId(String buildId)
	{
		_buildId = buildId;
	}

	public void OperatorConnectionType(int operatorConnectionType)
	{
		_operatorConnectionType = operatorConnectionType;
	}
	
	public void BangoUserId(String bangoUserId)
	{
		_bangoUserId = bangoUserId;
	}

	public int ProfileId()
	{
		return _profileId;
	}

	public int SdkType()
	{
		return _sdkType;
	}

	public String SdkVersion()
	{
		return _sdkVersion;
	}

	public String ApplicationId()
	{
		return _applicationId;
	}

	public String ApplicationType()
	{
		return _applicationType;
	}

	public String ApplicationChannel()
	{
		return _applicationChannel;
	}

	public String ApplicationVersion()
	{
		return _applicationVersion;
	}

	public String UserId()
	{
		return _userId;
	}

	public int SessionRestartTime()
	{
		return _sessionRestartTime;
	}

	public int ConnectionType()
	{
		return _connectionType;
	}

	public boolean IsRoaming()
	{
		return _isRoaming;
	}

	public String LocationSource()
	{
		return _locationSource;
	}

	public double LocationAltitude()
	{
		return _locationAltitude;
	}

	public double LocationLatitude()
	{
		return _locationLatitude;
	}

	public double LocationLongitude()
	{
		return _locationLongitude;
	}

	public float LocationAccuracy()
	{
		return _locationAccuracy;
	}

	public String Operator()
	{
		return _operator;
	}

	public String OperatorName()
	{
		return _operatorName;
	}

	public String OperatorCountryIso()
	{
		return _operatorCountryIso;
	}

	public String SimOperator()
	{
		return _simOperator;
	}

	public String Brand()
	{
		return _brand;
	}

	public String Device()
	{
		return _device;
	}

	public String Model()
	{
		return _model;
	}

	public String Product()
	{
		return _product;
	}

	public String Version()
	{
		return _version;
	}

	public String BuildId()
	{
		return _buildId;
	}

	public int OperatorConnectionType()
	{
		return _operatorConnectionType;
	}
	
	public String BangoUserId()
	{
		return _bangoUserId;
	}

	public BangoProfile()
	{

	}

	public BangoProfile(BangoProfile bangoProfile)
	{
		_sdkType = bangoProfile.SdkType();
		_sdkVersion = bangoProfile.SdkVersion();
		_applicationId = bangoProfile.ApplicationId();
		_applicationType = bangoProfile.ApplicationType();
		_applicationChannel = bangoProfile.ApplicationChannel();
		_applicationVersion = bangoProfile.ApplicationVersion();
		_userId = bangoProfile.UserId();
		_sessionRestartTime = bangoProfile.SessionRestartTime();
		_connectionType = bangoProfile.ConnectionType();
		_isRoaming = bangoProfile.IsRoaming();
		_operator = bangoProfile.Operator();
		_operatorName = bangoProfile.OperatorName();
		_operatorCountryIso = bangoProfile.OperatorCountryIso();
		_brand = bangoProfile.Brand();
		_device = bangoProfile.Device();
		_model = bangoProfile.Model();
		_product = bangoProfile.Product();
		_version = bangoProfile.Version();
		_buildId = bangoProfile.BuildId();
		_operatorConnectionType = bangoProfile.OperatorConnectionType();
		_simOperator = bangoProfile.SimOperator();

		_locationAltitude = bangoProfile.LocationAltitude();
		_locationLatitude = bangoProfile.LocationLatitude();
		_locationLongitude = bangoProfile.LocationLongitude();
		_locationAccuracy = bangoProfile.LocationAccuracy();
		_locationSource = bangoProfile.LocationSource();
		_bangoUserId = bangoProfile.BangoUserId();
	}

	public BangoProfile(int sdkType, String sdkVersion, String applicationId, String applicationType, String applicationChannel, String applicationVersion, String userId, int sessionRestartTime, int connectionType, boolean isRoaming, String locationSource, double locationAltitude, double locationLatitude, double locationLongitude, float locationAccuracy, String operator, String operatorName, String operatorCountryIso, String simOperator, String brand, String device, String model, String product, String version, String buildId, int operatorConnectionType, String bangoUserId)
	{
		_sdkType = sdkType;
		_sdkVersion = sdkVersion;
		_applicationId = applicationId;
		_applicationType = applicationType;
		_applicationChannel = applicationChannel;
		_applicationVersion = applicationVersion;
		_userId = userId;
		_sessionRestartTime = sessionRestartTime;
		_connectionType = connectionType;
		_isRoaming = isRoaming;
		_operator = operator;
		_operatorName = operatorName;
		_operatorCountryIso = operatorCountryIso;
		_brand = brand;
		_device = device;
		_model = model;
		_product = product;
		_version = version;
		_buildId = buildId;
		_operatorConnectionType = operatorConnectionType;
		_simOperator = simOperator;

		_locationAltitude = locationAltitude;
		_locationLatitude = locationLatitude;
		_locationLongitude = locationLongitude;
		_locationAccuracy = locationAccuracy;
		_locationSource = locationSource;
		
		_bangoUserId = bangoUserId;
	}

	public JSONObject GetDeviceProfile()
	{
		JSONObject returnValue = new JSONObject();
		try
		{
			returnValue.put(BangoFieldNames.POST_SDKTYPE, _sdkType);
			returnValue.put(BangoFieldNames.POST_SDKVERSION, _sdkVersion);
			returnValue.put(BangoFieldNames.POST_CONNECTIONTYPE, BangoStatic.ConnectionType(_connectionType));
			returnValue.put(BangoFieldNames.POST_OPERATORCONNECTIONTYPE, BangoStatic.OperatorConnectionType(_operatorConnectionType));
			returnValue.put(BangoFieldNames.POST_ISROAMING, _isRoaming);
			returnValue.put(BangoFieldNames.POST_LOCATIONACCURACY, _locationAccuracy);
			returnValue.put(BangoFieldNames.POST_LOCATIONSOURCE, _locationSource);
			returnValue.put(BangoFieldNames.POST_LOCATIONALTITUDE, _locationAltitude);
			returnValue.put(BangoFieldNames.POST_LOCATIONLATITUDE, _locationLatitude);
			returnValue.put(BangoFieldNames.POST_LOCATIONLONGITUDE, _locationLongitude);
			returnValue.put(BangoFieldNames.POST_APPLICATIONID, _applicationId);
			returnValue.put(BangoFieldNames.POST_APPLICATIONCHANNEL, _applicationChannel);
			returnValue.put(BangoFieldNames.POST_APPLICATIONTYPE, _applicationType);
			returnValue.put(BangoFieldNames.POST_APPLICATIONVERSION, _applicationVersion);
			returnValue.put(BangoFieldNames.POST_USERID, _userId);
			returnValue.put(BangoFieldNames.POST_SESSIONRESTARTTIME, _sessionRestartTime);
			returnValue.put(BangoFieldNames.POST_OPERATOR, _operator);
			returnValue.put(BangoFieldNames.POST_OPERATORNAME, _operatorName);
			returnValue.put(BangoFieldNames.POST_COUNTRYISO, _operatorCountryIso);
			returnValue.put(BangoFieldNames.POST_DEVICEBRAND, _brand);
			returnValue.put(BangoFieldNames.POST_DEVICEMAKE, _device);
			returnValue.put(BangoFieldNames.POST_DEVICEMODEL, _model);
			returnValue.put(BangoFieldNames.POST_SIM, _simOperator);
			returnValue.put(BangoFieldNames.POST_PRODUCT, _product);
			returnValue.put(BangoFieldNames.POST_OPERATINGSYSTEMVERSION, _version);
			returnValue.put(BangoFieldNames.POST_DEVICEVERSION, _buildId);
			if(_bangoUserId != null) returnValue.put(BangoFieldNames.POST_BANGOUSERID, _bangoUserId);
		}
		catch (Exception ex)
		{

		}

		return returnValue;
	}

}
